﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>修改字段名</title>
    <!--link href="../../../Scripts/easyUI145/themes/icon.css" rel="stylesheet" type="text/css" />
    <script src="../../../Scripts/easyUI145/jquery.min.js"></script>
    <script src="../../../Scripts/easyUI145/jquery.easyui.min.js" type="text/javascript"></script>
    <link href="../../../Scripts/easyUI145/themes/default/easyui.css" rel="stylesheet" type="text/css" /-->
    <link href="../../DataUser/Style/ccbpm.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../../WF/Scripts/bootstrap/js/jquery.min.js"></script>
    <script type="text/javascript" src="../../WF/Scripts/bootstrap/js/bootstrap.min.js"></script>
    <script src="../../WF/Scripts/QueryString.js" type="text/javascript"></script>
    <script src="../../WF/Scripts/config.js" type="text/javascript"></script>
    <script src="../../WF/Scripts/QueryString.js" type="text/javascript"></script>
    <script src="../../WF/Comm/Gener.js" type="text/javascript"></script>
    <script src="../../WF/Portal/js/vue/vue.js" type="text/javascript"></script>
    <style>
        .pull-right {
            float: right;
            text-align: right
        }

        .cur {
            cursor: pointer
        }

        .Kclass {
            border: 0px;
            color: #ff6a00;
            padding: 3px 5px;
            width: 80%
        }

            .Kclass:focus {
                border-bottom: 1px solid #ff6a00;
                padding: 2px 4px 3px;
            }
    </style>
    <script type="text/javascript">
        var frmID = "";
        //页面启动函数.
        $(function () {

            InitBar("KeyOfEn");

            frmID = GetQueryString("FrmID");

        

            //所有的字段.
            var handler = new HttpHandler("BP.WF.HttpHandler.WF_Admin_FoolFormDesigner_Batch");
            handler.AddPara("FrmID", frmID);
            var data = handler.DoMethodReturnJSON("KeyOfEn_Init");

            console.log(data);

            //字段分组.
            var gfs = new Entities("BP.Sys.GroupFields");
            gfs.Retrieve("FrmID", frmID, "Idx");
            //生成列表.

        });

       
        //单行的保存。
        function SaveOne(oldName, newName) {

            if (oldName == newName)
                return "";

            var en = new Entities("BP.Sys.FrmUI.MapAttrString", frmID + "_" + oldName);
            var data = en.DoMethodReturnString("DoRenameField", newName);

            return data;
        }

        function Reset() {
            var no = GetQueryString("No")
            var en = new Entity("BP.PM.FeeType", no);
            en.DoMethodReturnString("DoReset");
            Reload();
        }

    </script>
</head>
<body>
    <div class="container-fluid" id="KeyEn" style=" margin:15px 0px;">
        <div class="row" style=" margin:0px 0px 15px;">

            <!--<div class="col-sm-6">
                <button @click.stop="Save()" class="btns btn-primary">保存</button>
            </div>-->

            <div class="col-sm-6">
                <button @click.stop="Reset()" class="btns btn-primary">重置表单(显示所有的字段)</button>
            </div>

            <div class="col-sm-4 pull-right"><div id="bar"></div></div>
        </div>

        <div class="KeyEn">
            <table class="table">
                <tr>
                    <th>Idx</th>
                    <th>名称</th>
                    <th>字段类型</th>
                    <th>字段名</th>
                    <th>显示？</th>
                </tr>
                <tr v-for="(item,index) in list">
                    <td> {{index+1}}</td>
                    <td><label> <input type="checkbox" id="{{item.KeyOfEn}}" /> {{item.Name}} </label></td>
                    <td>{{item.MyDataType}}</td>
                    <td>{{item.KeyOfEn}}</td>
                    <td><label> <input type="checkbox" id="{{item.KeyOfEn}}" /> {{item.Name}} </label></td>
                </tr>

            </table>

        </div>
    </div>
    <script>
        var editPK = '';
        new Vue({
            el: '#KeyEn',
            data: {
                list: [],
            },
            methods: {
                EditName: function (e, EName) {
                    var EList = this.list
                    EList[e].Ename = EName
                },
                WirteName: function (i, e) {
                    var WList = this.list
                    WList[i].Ename = e.target.value

                },
                Save: function () {
                    console.log(this.list)
                }
            },
            mounted: function () {

                frmID = GetQueryString("FrmID");
                var freeNo = GetQueryString("FreeTypeNo");

                var mapAttr = new Entities("BP.Sys.MapAttrs");
                mapAttr.Retrieve("FK_MapData", frmID, "GroupID, Idx");

                this.list = mapAttr.TurnToArry();;
            }
        });

    </script>
</body>
</html>
